package com.hdoit.ares.web.personnel.modelconfig;

import com.hdoit.ares.selfcommon.enums.personnel.ParamMapper;
import com.hdoit.ares.web.personnel.providers.PersonnelBusinessProvider;
import com.tennetcn.common.enums.regular.RegularExpressions;
import com.tennetcn.component.attribute.DateTimeAttribute;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.cbase.providers.ParamDataProvider;
import com.tennetcn.web.superbase.modelconfig.EmployeeConfig;

/**
 * @author caochengmeng
 * @email
 * @createtime 2017年11月15日 10:09:24
 * @comment
 */
public class PersonnelConfig extends EmployeeConfig {
	public PersonnelConfig() {

		this.setProperty("birthday")
			.hasAttribute(new DisplayNameAttribute("生日"))
			.hasAttribute(new DateTimeAttribute());

		this.setProperty("joinUsDate")
			.hasAttribute(new DisplayNameAttribute("加入时间"))
			.hasAttribute(new DateTimeAttribute());

		this.setProperty("jobDuty")
			.hasAttribute(new DisplayNameAttribute("工作职责"))
			.hasAttribute(new DropDownListAttribute(new ParamDataProvider(ParamMapper.basicJobDuty)));

		this.setProperty("liveAddress")
			.hasAttribute(new DisplayNameAttribute("现居住地址"));
		
		this.setProperty("idCard")
			.hasAttribute(new DisplayNameAttribute("身份证号"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.idCard));

		this.setProperty("qq")
			.hasAttribute(new DisplayNameAttribute("qq号"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.qq));
		
		this.setProperty("businessId")
			.hasAttribute(new DisplayNameAttribute("公司"))
			.hasAttribute(new DropDownListAttribute(new PersonnelBusinessProvider(), false));
		
		this.setProperty("roleIds")
			.hasAttribute(new DisplayNameAttribute("角色"));
			/*.hasAttribute(new DropDownListAttribute(new PersonnelRoleProvider()));*/
	}
}
